home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 November / Chip Kasım 2000.iso / prog / share / 11 / setup.exe / %MAINDIR% / DEMOS / CIUU / UUENCODE / frmmain.frm (.txt) next >
Encoding:
Visual Basic Form  |  2000-09-07  |  9.4 KB  |  280 lines

  1. VERSION 4.00
  2. Begin VB.Form frmMain 
  3.    Caption         =   "Crescent Internet ToolPak UUEncode/UUDecode OLE Control"
  4.    ClientHeight    =   2880
  5.    ClientLeft      =   1155
  6.    ClientTop       =   2235
  7.    ClientWidth     =   7065
  8.    Height          =   3285
  9.    Left            =   1095
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   2880
  12.    ScaleWidth      =   7065
  13.    Top             =   1890
  14.    Width           =   7185
  15.    Begin VB.CommandButton cmdQuit 
  16.       Caption         =   "Quit"
  17.       Height          =   375
  18.       Left            =   5760
  19.       TabIndex        =   6
  20.       Top             =   600
  21.       Width           =   1095
  22.    End
  23.    Begin VB.Frame fraStatus 
  24.       Height          =   135
  25.       Left            =   240
  26.       TabIndex        =   3
  27.       Top             =   1080
  28.       Width           =   6615
  29.    End
  30.    Begin VB.CommandButton cmdDecode 
  31.       Caption         =   "Decode A File"
  32.       Height          =   375
  33.       Left            =   240
  34.       TabIndex        =   2
  35.       Top             =   600
  36.       Width           =   2295
  37.    End
  38.    Begin VB.CommandButton cmdEncode 
  39.       Caption         =   "Encode A File"
  40.       Height          =   375
  41.       Left            =   240
  42.       TabIndex        =   1
  43.       Top             =   120
  44.       Width           =   2295
  45.    End
  46.    Begin VB.Label lblDFSize 
  47.       Alignment       =   1  'Right Justify
  48.       Caption         =   "Destination File Size:"
  49.       Height          =   255
  50.       Left            =   240
  51.       TabIndex        =   12
  52.       Top             =   2520
  53.       Width           =   1575
  54.    End
  55.    Begin VB.Label lblDFName 
  56.       Alignment       =   1  'Right Justify
  57.       Caption         =   "Destination Filename:"
  58.       Height          =   255
  59.       Left            =   240
  60.       TabIndex        =   11
  61.       Top             =   2160
  62.       Width           =   1575
  63.    End
  64.    Begin VB.Label lblSFSize 
  65.       Alignment       =   1  'Right Justify
  66.       Caption         =   "Source File Size:"
  67.       Height          =   255
  68.       Left            =   240
  69.       TabIndex        =   10
  70.       Top             =   1800
  71.       Width           =   1575
  72.    End
  73.    Begin VB.Label lblSFName 
  74.       Alignment       =   1  'Right Justify
  75.       Caption         =   "Source Filename:"
  76.       Height          =   255
  77.       Left            =   240
  78.       TabIndex        =   9
  79.       Top             =   1440
  80.       Width           =   1575
  81.    End
  82.    Begin VB.Label lblDestinationFilesize 
  83.       Alignment       =   1  'Right Justify
  84.       BorderStyle     =   1  'Fixed Single
  85.       Height          =   255
  86.       Left            =   1920
  87.       TabIndex        =   8
  88.       Top             =   2520
  89.       Width           =   2055
  90.    End
  91.    Begin VB.Label lblSourceFilesize 
  92.       Alignment       =   1  'Right Justify
  93.       BorderStyle     =   1  'Fixed Single
  94.       Height          =   255
  95.       Left            =   1920
  96.       TabIndex        =   7
  97.       Top             =   1800
  98.       Width           =   2055
  99.    End
  100.    Begin VB.Label lblDestinationFilename 
  101.       BorderStyle     =   1  'Fixed Single
  102.       Height          =   255
  103.       Left            =   1920
  104.       TabIndex        =   5
  105.       Top             =   2160
  106.       Width           =   3855
  107.    End
  108.    Begin VB.Label lblSourceFilename 
  109.       BorderStyle     =   1  'Fixed Single
  110.       Height          =   255
  111.       Left            =   1920
  112.       TabIndex        =   4
  113.       Top             =   1440
  114.       Width           =   3855
  115.    End
  116.    Begin ComctlLib.ProgressBar prgEncode 
  117.       Height          =   375
  118.       Left            =   240
  119.       TabIndex        =   0
  120.       Top             =   2880
  121.       Width           =   5535
  122.       _Version        =   65536
  123.       _ExtentX        =   9763
  124.       _ExtentY        =   661
  125.       _StockProps     =   192
  126.       Appearance      =   1
  127.       BorderStyle     =   1
  128.    End
  129.    Begin CIUULib.CIUU CIUU1 
  130.       Height          =   450
  131.       Left            =   6240
  132.       Top             =   1440
  133.       Width           =   480
  134.       _Version        =   65536
  135.       _ExtentX        =   847
  136.       _ExtentY        =   794
  137.       _StockProps     =   0
  138.       SourceFilename  =   ""
  139.       DestinationFilename=   ""
  140.    End
  141. Attribute VB_Name = "frmMain"
  142. Attribute VB_Creatable = False
  143. Attribute VB_Exposed = False
  144. Private Sub CIUU1_Decoded(ByVal BytesRead As Long, ByVal BytesWritten As Long, ByVal LinesDecoded As Long)
  145.   '   update progress with total bytes read
  146.   '   throughout the decode phase
  147.   prgEncode.Value = BytesRead
  148. End Sub
  149. Private Sub CIUU1_DecodingFinished(ByVal Error As Integer)
  150.   '   display the actual destination
  151.   '   file size
  152.   lblDestinationFilesize.Caption = Format(CIUU1.DestinationFileSize, _
  153.     "###,###,###")
  154.   '   display the source file name you
  155.   '   just decoded
  156.   MsgBox ("Finished decoding " & CIUU1.SourceFilename)
  157.   '   enable all buttons
  158.   cmdDecode.Enabled = True
  159.   cmdEncode.Enabled = True
  160.   cmdQuit.Enabled = True
  161. End Sub
  162. Private Sub CIUU1_DecodingStarted()
  163.   '   disable all buttons
  164.   '   because we are busy
  165.   cmdDecode.Enabled = False
  166.   cmdEncode.Enabled = False
  167.   cmdQuit.Enabled = False
  168.   '   intialize the progress bar
  169.   '   maximum
  170.   prgEncode.Max = CIUU1.SourceFileSize
  171.   '   expand form so we can see
  172.   '   the progress bar
  173.   frmMain.Height = 3795
  174.   '   display source and destination
  175.   '   file name
  176.   lblSourceFilename.Caption = CIUU1.SourceFilename
  177.   lblDestinationFilename.Caption = CIUU1.DestinationFilename
  178.   '   display the actual source
  179.   '   file size
  180.   lblSourceFilesize.Caption = Format(CIUU1.SourceFileSize, _
  181.   "###,###,###")
  182.   '   calculate the approximate destination
  183.   '   file size based on the source file size
  184.   nDestinationFilesize& = CIUU1.SourceFileSize - (CIUU1.SourceFileSize * 0.291)
  185.   lblDestinationFilesize.Caption = "approximately " & Format(Str$(LTrim$(nDestinationFilesize&)), _
  186.     "###,###,###")
  187. End Sub
  188. Private Sub CIUU1_Encoded(ByVal BytesRead As Long, ByVal BytesWritten As Long, ByVal LinesEncoded As Long)
  189.   '   update progress with total bytes read
  190.   '   throughout the encode phase
  191.   prgEncode.Value = BytesRead
  192. End Sub
  193. Private Sub CIUU1_EncodingFinished(ByVal Error As Integer)
  194.   '   display the actual destination
  195.   '   file size
  196.   lblDestinationFilesize.Caption = Format(CIUU1.DestinationFileSize, _
  197.     "###,###,###")
  198.   '   display the source file name you
  199.   '   just decoded
  200.   MsgBox ("Finished encoding " & CIUU1.SourceFilename)
  201.   '   enable all buttons
  202.   cmdDecode.Enabled = True
  203.   cmdEncode.Enabled = True
  204.   cmdQuit.Enabled = True
  205. End Sub
  206. Private Sub CIUU1_EncodingStarted()
  207.   '   disable all buttons
  208.   '   because we are busy
  209.   cmdDecode.Enabled = False
  210.   cmdEncode.Enabled = False
  211.   cmdQuit.Enabled = False
  212.   '   intialize the progress bar
  213.   '   maximum
  214.   prgEncode.Max = CIUU1.SourceFileSize
  215.   '   expand form so we can see
  216.   '   the progress bar
  217.   frmMain.Height = 3795
  218.   '   display source and destination
  219.   '   file name
  220.   lblSourceFilename.Caption = CIUU1.SourceFilename
  221.   lblDestinationFilename.Caption = CIUU1.DestinationFilename
  222.   '   display the actual source
  223.   '   file size
  224.   lblSourceFilesize.Caption = Format(CIUU1.SourceFileSize, _
  225.   "###,###,###")
  226.   '   calculate the approximate destination
  227.   '   file size based on the source file size
  228.   nDestinationFilesize& = CIUU1.SourceFileSize + (CIUU1.SourceFileSize * 0.4009)
  229.   lblDestinationFilesize.Caption = "approximately " & Format(Str$(LTrim$(nDestinationFilesize&)), _
  230.     "###,###,###")
  231. End Sub
  232. Private Sub cmdDecode_Click()
  233.   '   decode a specified file if a file has not been
  234.   '   specified, dialog boxes will prompt you for a
  235.   '   source and destination file
  236.   '   UUDecode initiates the decoding operation
  237.   '   which causes the DecodingStarted event to
  238.   '   fire. When the decoding operation completes,
  239.   '   the DecodingFinished event fires. If you set
  240.   '   the FireStatus property to True, the Decoded
  241.   '   event fires during the decoding operation
  242.   '   (depending on the file size).
  243.   CIUU1.UUDecode
  244. End Sub
  245. Private Sub cmdEncode_Click()
  246.   '   encode a specified file if a file has not been
  247.   '   specified, dialog boxes will prompt you for a
  248.   '   source and destination file
  249.   '   UUEncode initiates the encoding operation
  250.   '   which causes the EncodingStarted event to
  251.   '   fire. When the encoding operation completes,
  252.   '   the EncodingFinished event fires. If you set
  253.   '   the FireStatus property to True, the Encoded
  254.   '   event fires during the decoding operation
  255.   '   (depending on the file size).
  256.   CIUU1.UUEncode
  257. End Sub
  258. Private Sub cmdQuit_Click()
  259.   '   end the application
  260.   End
  261. End Sub
  262. Private Sub Form_Load()
  263.   ' -------------------------------------------------------------------
  264.   ' Title:          UUEncode
  265.   ' Description:    Demonstrates the Crescent CIUU ActiveX Component allowing
  266.   '                 user selectable file encoding/decoding of any size
  267.   '                 file.
  268.   ' Author:         Stephen Casella
  269.   ' Last Revision:  May 2, 1996
  270.   ' -------------------------------------------------------------------
  271.   '   center main form
  272.   frmMain.Top = Screen.Height \ 2 - frmMain.Height \ 2
  273.   frmMain.Left = Screen.Width \ 2 - frmMain.Width \ 2
  274.   '   explicitly show the form
  275.   frmMain.Show
  276.   '   initialize the progress
  277.   '   bar minimum
  278.   prgEncode.Min = 0
  279. End Sub
  280.